package com.yl.chainStore.entity

import com.alibaba.druid.support.json.JSONUtils
import com.alibaba.fastjson.JSONArray
import com.alibaba.fastjson.JSONObject
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler
import org.apache.ibatis.type.JdbcType


open class OtherShow(
) {
	@TableField(value = "other",jdbcType=JdbcType.OTHER,typeHandler = FastjsonTypeHandler::class)
	var other:Any?=null
	set(value) {
		field = if(value is Map<*, *>){
			value as Any
		}else{
			value
		}
	}


	val otherJson:JSONObject?
		get() {
			if(other != null){
				return if(other is Map<*, *>){
					JSONObject.parseObject(JSONUtils.toJSONString(other))
				}else{
					JSONObject.parseObject(other.toString())
				}
			}
			return null
		}
}
